<template>
	<view class="order-list">
		<view v-for="(item, index) in orderList" :key="index" class="li" @tap="toSkill()">
			<view class="title">
				<text class="order">订单：{{ item.cartId }}</text>
				<text class="state"></text>
			</view>
			<view class="main">
				<image class="image" :src="item.coverPhoto || noPic" mode="aspectFill"></image>
				<view class="info">
					<view class="product">
						<text class="name">{{ item.prodName }}</text>
						<view class="price">
							<text class="unit">秒杀价￥</text>
							<text class="money">{{ item.killPrice }}</text>
						</view>
					</view>
					<view class="desc">
						<view class="remark">备注：{{ item.remark }}</view>
						<view class="num">x{{ item.goodsNum }}</view>
					</view>
					<view class="date">{{ item.createTime }}</view>
					<view class="total">
						<text>共{{ item.goodsNum }}件商品，实付款<text class="unit">￥</text>{{ item.killPrice }}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		listProductSeckillOrder
	} from '../../api/order/orderApi.js';
	
	export default {
		name:"vc-order",
		props: {
			mode: String
		},
		data() {
			return {
				orderList: []
			};
		},
		
		created() {
			this.handleQuery();
		},
		methods: {
			handleQuery() {
				listProductSeckillOrder({
					page: 1,
					row: 50
				}).then(data=> {
					this.orderList = data;
				})
			},
			toSkill() {
				uni.navigateTo({
					url: '/pages/goods/seckillList'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.order-list {
		background: #FFF;
		.li {
			padding: 30rpx;
			margin: 15rpx 0;
		}
		.title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.state {
				color: #909399;
				font-size: 24rpx;
			}
		}
		.main {
			display: flex;
			margin-top: 20rpx;
			.image {
				width: 160rpx;
				height: 160rpx;
				margin-right: 25rpx;
				border-radius: 20rpx;
			}
			.info {
				flex: 1;
				.product {
					display: flex;
					justify-content: space-between;
					align-items: center;
					.price {
						.unit {
							font-size: 24rpx;
						}
						.money {
							font-size: 35rpx;
						}
					}
				}
				.desc {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-top: 18rpx;
					.num {
						color: #909399;
						font-size: 24rpx;
					}
				}
				.date {
					color: #909399;
					margin-top: 18rpx;
				}
			}
			.total {
				text-align: right;
				margin-top: 25rpx;
				.unit {
					font-size: 24rpx;
				}
			}
		}
	}
</style>